<script lang="ts" setup>
  interface MediaProps {
    coverProps?: any;
  }

  withDefaults(defineProps<MediaProps>(), {
    coverProps: {
      width: 100,
      height: 100,
    },
  });
</script>

<template>
  <div class="umi-media">
    <div class="umi-media-cover" v-if="!$slots.cover">
      <umrp-image v-bind="coverProps"></umrp-image>
    </div>
    <slot name="cover" v-else></slot>
    <div class="umi-media-body">
      <slot></slot>
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .umi-media {
    display: flex;
    gap: 10px;

    &-body {
      flex: 1;
    }
  }
</style>
